package com.jxb.visibility.synized;

public class CreateWay {

    //锁住的是类对象
    public synchronized static void testway1() {

    }

    //锁住的实列对象
    public synchronized void shilietest() {

    }

    //锁住实列对象
    public void shilietest1() {
        synchronized (this) {

        }
    }

    //锁住类对象
    public void leiduixiang() {
        synchronized (CreateWay.class) {

        }
    }

    private String str = "";

    //锁住Object实列对象
    public void objectshilie() {
        synchronized (str) {

        }
    }
}
